/**
 * FileName: OrderController
 *
 * @author: 阿张
 * Date:     2021/3/7 19:29
 */
package com.qx.controller;

import com.qx.pojo.ScOrder;
import com.qx.service.ScOrderService;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import result.Result;
import result.ResultFactory;

import javax.annotation.Resource;

@RestController
@RequestMapping("app/order/")
public class OrderController {

    @Resource
    private ScOrderService scOrderService;

    @RequestMapping("save")
    public Result save(@RequestBody ScOrder scOrder){
        boolean save = scOrderService.save(scOrder);
        if (save){
            return ResultFactory.buildSuccessResult("成功");
        }
        return ResultFactory.buildFailResult("失败");
    }
}
